package vn.wallet.app.domain;

// Generated Nov 15, 2012 12:09:27 PM by Hibernate Tools 3.4.0.CR1

import static javax.persistence.GenerationType.IDENTITY;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Scheduler generated by hbm2java
 */
@Entity
@Table(name = "scheduler", catalog = "wallet")
public class Scheduler implements java.io.Serializable {

	/**
	 * 
	 */
	private static final long	serialVersionUID	= 1L;
	private Integer				id;
	private int					userId;
	private int					type;
	private String				pattern;
	private int					scheduleFor;
	private Date				beginOn;
	private Date				finishOn;
	private boolean				status;
	private Set<Budget>			budgets				= new HashSet<Budget>(0);

	public Scheduler() {
	}

	public Scheduler(int userId, int type, int scheduleFor, Date beginOn,
			boolean status) {
		this.userId = userId;
		this.type = type;
		this.scheduleFor = scheduleFor;
		this.beginOn = beginOn;
		this.status = status;
	}

	public Scheduler(int userId, int type, String pattern, int scheduleFor,
			Date beginOn, Date finishOn, boolean status, Set<Budget> budgets) {
		this.userId = userId;
		this.type = type;
		this.pattern = pattern;
		this.scheduleFor = scheduleFor;
		this.beginOn = beginOn;
		this.finishOn = finishOn;
		this.status = status;
		this.budgets = budgets;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@Column(name = "user_id", nullable = false)
	public int getUserId() {
		return this.userId;
	}

	public void setUserId(int userId) {
		this.userId = userId;
	}

	@Column(name = "type", nullable = false)
	public int getType() {
		return this.type;
	}

	public void setType(int type) {
		this.type = type;
	}

	@Column(name = "pattern", length = 20)
	public String getPattern() {
		return this.pattern;
	}

	public void setPattern(String pattern) {
		this.pattern = pattern;
	}

	@Column(name = "schedule_for", nullable = false)
	public int getScheduleFor() {
		return this.scheduleFor;
	}

	public void setScheduleFor(int scheduleFor) {
		this.scheduleFor = scheduleFor;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "begin_on", nullable = false, length = 19)
	public Date getBeginOn() {
		return this.beginOn;
	}

	public void setBeginOn(Date beginOn) {
		this.beginOn = beginOn;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "finish_on", length = 19)
	public Date getFinishOn() {
		return this.finishOn;
	}

	public void setFinishOn(Date finishOn) {
		this.finishOn = finishOn;
	}

	@Column(name = "status", nullable = false)
	public boolean isStatus() {
		return this.status;
	}

	public void setStatus(boolean status) {
		this.status = status;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "scheduler")
	public Set<Budget> getBudgets() {
		return this.budgets;
	}

	public void setBudgets(Set<Budget> budgets) {
		this.budgets = budgets;
	}

}
